Skip to content

GH issue 1092 & 1096: Filters in saved views break column value contains semicolon or column name contains apostrophe#7624

Open
XingY wants to merge 4 commits intodevelopfrom
fb_mvtcConvertSpecial
Open

GH issue 1092 & 1096: Filters in saved views break column value contains semicolon or column name contains apostrophe#7624
XingY wants to merge 4 commits intodevelopfrom
fb_mvtcConvertSpecial

Conversation

@XingY
Copy link
Copy Markdown
Contributor

@XingY XingY commented Apr 28, 2026

Rationale

Issue 1092 & 1096

  1. Single quote url encoding is handled differently by different browsers, FF doesn't encode it but chrome does. This results in different filter values persisted in customview depending on the browser that the view is saved from. To match converted columns, a change is made to attempt both encoded and unencoded single quote when comparing names.
  2. Filter values were not converted during column type conversion. The filter is either dropped, or the filter operator is updated only. This is problematic when converting between single and multi value filter types. For single filter, semicolon is not encoded, not special handled. For multi filter, depending on if any value contains semicolon, the filter value is either a special json array, or is a plain ; concatenated string. To avoid broken filters after field type conversion, the following change of behavior is introduced:
  • For MVTC -> TC, arraymatches is converted to in, arraynotmatches is converted to notin, if the fitler value contains semicolon. If the value doesn't contain semicolon, they continue to convert to eq and neqornull, as before.
  • For TC -> MVTC, if the filter value contains semicolon, the filter is dropped.

Related Pull Requests

Changes

@XingY XingY requested a review from cnathe April 28, 2026 18:53

// GitHub Issue 1096: Filters in saved views break after MVTC → TC conversion if column value contains semicolon
// if the single value contains ";", the filter is saved as {json:[]} for MVTC, needs to convert to multi value filter types (for example, 'in' instead of 'eq').
boolean isJsonArrayFilterValue = filterStr.indexOf(JSON_ARRAY_FILTER_PREFIX) > 0 && filterStr.endsWith(JSON_ARRAY_FILTER_SUFFIX);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a check that it starts at index 0 instead of just > 0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This as currently is should be > 0 instead of 0 since the string contains dataregion.query~op prefix.

return filterStr;

// if the single value filter value contains ";", drop the filter after converting to array type filter since the filter value is no longer valid
return "";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems a little backwards to me. I would have expected things check to go in the opposite direction where if the if statement was true for "valuePart contains ENCODED_SEMICOLON" then return empty string and the fallback / end of method to return filterStr. is there some reason that wouldn't work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants